Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature table cell stretched #1514

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Mar 26, 2022

This is a partial fix for: #1273, this solution seems to work in firefox but does not work in Edge (chromium based).

Given that most major contest do install firefox I think merging this is still acceptable.

I've now kept the border to show which element is stretched but that will be removed when merging.

I've now implemented a solution with 2 browserhacks. In the end we can set 1 and override the shared properties in the browserhack after it. The browserhack for firefox looks depricated but according to https://sass-lang.com/documentation/breaking-changes/moz-document/ this specific behaviour is kept (so reasonable safe to use).

@meisterT meisterT requested a review from thijskh March 27, 2022 11:46
@vmcj vmcj marked this pull request as ready for review March 28, 2022 18:02
@thijskh
Copy link
Member

thijskh commented Apr 15, 2022

It does not seem to work for me, in my FF 99 on MacOS I still see the gaps between the cells:
afbeelding

@vmcj vmcj closed this Apr 29, 2022
@vmcj
Copy link
Member Author

vmcj commented Jul 31, 2023

@thijskh can you take a look again?

I've now done 2 browser hacks to make it easier to change something between either a gecko engine (firefox only at this point?) and something chromium based (Chrome, Edge, Safari & Opera(?)).

If this does work for you I can see if I can deduplicate and fix the margin/padding etc. but I prefer to first be sure that this fixes the original issue.

@vmcj vmcj reopened this Jul 31, 2023
@vmcj vmcj force-pushed the feature_table_cell_stretched branch 2 times, most recently from 8dc29b3 to 9d6cae4 Compare August 1, 2023 06:57
@thijskh
Copy link
Member

thijskh commented Aug 15, 2023

It's not beautiful but seems to do the trick.

I don't understand the comments about diffs.

@vmcj
Copy link
Member Author

vmcj commented Aug 15, 2023

It's not beautiful but seems to do the trick.

Ok, than I'll deduplicate the shared parts and squash everything to one commit.

I don't understand the comments about diffs.

They were placeholders to make sure that the differences between commits would point at the right parts instead of git showing differences between unrelated parts.
If there was a better way to steer the algorithm I would like to learn that.

@vmcj vmcj force-pushed the feature_table_cell_stretched branch from 9d6cae4 to 0c2cabd Compare August 16, 2023 06:21
@nickygerritsen
Copy link
Member

They were placeholders to make sure that the differences between commits would point at the right parts instead of git showing differences between unrelated parts. If there was a better way to steer the algorithm I would like to learn that.

I still don't really understand the issue but I assume we get rid of the comments before squashing?

@vmcj
Copy link
Member Author

vmcj commented Aug 16, 2023

They were placeholders to make sure that the differences between commits would point at the right parts instead of git showing differences between unrelated parts. If there was a better way to steer the algorithm I would like to learn that.

I still don't really understand the issue but I assume we get rid of the comments before squashing?

Yes,

@vmcj vmcj force-pushed the feature_table_cell_stretched branch from 3375938 to 06d65c1 Compare August 19, 2023 09:37
@vmcj
Copy link
Member Author

vmcj commented Aug 19, 2023

Its now 1 commit, and the commit message should explain most (if not all) of the questions.

@nickygerritsen / @thijskh I think the browserhack should be stable enough to merge this, can you take a look again? I would prefer to have this in main before the next prelim to test that everything works.

Copy link
Member

@nickygerritsen nickygerritsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works I'm fine with the plan

@vmcj vmcj force-pushed the feature_table_cell_stretched branch from 06d65c1 to 5cc03a6 Compare August 19, 2023 10:06
@thijskh
Copy link
Member

thijskh commented Aug 19, 2023

I'm not convinced it's an improvement just yet. The scoreboard cells look off, as do the claim buttons.

Displaced cells on scoreboard
stretched buttons on submission list

@vmcj
Copy link
Member Author

vmcj commented Aug 24, 2023

I'm not convinced it's an improvement just yet. The scoreboard cells look off, as do the claim buttons.

Displaced cells on scoreboard stretched buttons on submission list

I can reproduce this. I've now tested this with W10/Edge and there all looks correct. W10/FF also looks correct but I'll test with another OS/FF some more.

@vmcj vmcj force-pushed the feature_table_cell_stretched branch 3 times, most recently from ecb9b93 to e5b3d20 Compare August 27, 2023 19:47
@vmcj
Copy link
Member Author

vmcj commented Aug 27, 2023

I think this is now fixed without the browserhack by combining the stuff needed for Firefox & Edge. I've fixed the issue @thijskh found by putting this in a class as most of our tables come from the macro.

One annoying thing is the claim button on the submissions_list page which I now needed to move by cheating with the padding of some columns. As we only have this for that one table I think it is fine but an alternative would be to remove the button or put it in another span.

See DOMjudge#1273 for the full
explaination.

This needs some hacks in CSS for firefox & chromium (or the other way around is also
possible) given that most major browsers are now chromium based it makes
sense to use that as default.

The selector `td:not(.testcase-results)` is to make sure that we are reasonable
specific to be applied on the tables, it does actually target everything
because the testcase-results class doesn't have anchors in the cells.

All the anchor tags are now stretched to us the full space inside the
TD.

Based partly on logic in:
https://stackoverflow.com/questions/18488148/how-to-get-div-height-100-inside-td-of-100#comment120502212_18488334

This has as disadvantage that we need the extra classes to keep the rounded buttons (a + border) aligned but as we only have this once it should be accepted.
@vmcj vmcj force-pushed the feature_table_cell_stretched branch from 8ec35a3 to b9eec15 Compare October 18, 2023 21:38
@vmcj vmcj merged commit 122c545 into DOMjudge:main Oct 18, 2023
18 of 19 checks passed
@vmcj vmcj deleted the feature_table_cell_stretched branch October 18, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants